package demo3;

public class TestAnimal {
    public static void main(String[] args) {
        Cat cat=new Cat("aaa");
        cat.run();
        Duck duck=new Duck("bbb");
        duck.fly();
        duck.run();
        duck.swim();
        Fish fish=new Fish("ccc");
        fish.swim();
        walk(cat);
        walk(duck);
    }
    public static void walk(IRunning iRunning){
        iRunning.run();
    }
}
